package org.rv.picmgr2;

import java.text.Normalizer;
import java.util.regex.Pattern;

public class StringUtil {

    public static boolean isBlank(String s) {
        if (s == null) {
            return true;
        }
        if (s.trim().length() == 0) {
            return true;
        }
        return false;
    }

    final static Pattern pattern = Pattern.compile("\\p{InCombiningDiacriticalMarks}+");//$NON-NLS-1$
 
    public static String stripAccents(final String input) {
        if (input == null) {
            return null;
        }
        final String decomposed = Normalizer.normalize(input, Normalizer.Form.NFD);
        return pattern.matcher(decomposed).replaceAll("");//$NON-NLS-1$
    }
}
